//-------------------------------添加用户操作---------------------------------
let form = layui.form
form.verify({
    same: function (value) {
        let val = $('.layui-form input[name=password]').val()
        if (value !== val) {
            return '两次输入的密码不一致'
        }
    }
})
//-------------------------l------添加用户操作---------------------------------
$('.layui-form').on('submit', function (e) {
    e.preventDefault()
    let fd = $(this).serialize()
    $.ajax({
        type: 'post',
        url: 'admin/users',
        data: fd,
        success: function (res) {
            // console.log(res);
            layer.msg(res.message)
        }
    })
})